package vn.fpt.fsoft.entities;

// Generated May 5, 2014 11:06:28 AM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Service generated by hbm2java
 */
@Entity
@Table(name = "Service")
public class Service implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -722056896356984590L;
	private int serviceId;
	private String serviceName;
	private String shortDescription;
	private int subTypeId;
	private Contact contact;
	private String clientDescription;
	private int serviceAttendableId;
	private Integer deptCode;
	private int serviceTypeId;
	private int details2;
	private int details3;
	private Boolean status;
	private Date startExpectedDate;
	private Date startDate;
	private Date endDate;
	private String serviceFullDescription;
	private String descriptionDelivery;
	private int serviceContractCode;
	private String serviceContractValue;
	private Boolean isContractStagedPayment;
	private int referralMethodId;
	private int timeLimitedYear;
	private int timeLimitedMonth;
	private Set<Premise> premises = new HashSet<Premise>(0);
	private Set<Organisation> organisationServices = new HashSet<Organisation>(
			0);
	private Set<ReferenceData> referenceData = new HashSet<ReferenceData>(0);

	public Service() {
	}

	/**
	 * @return the serviceId
	 */

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ServiceId", nullable = false)
	public int getServiceId() {
		return serviceId;
	}

	/**
	 * @param serviceId
	 *            the serviceId to set
	 */
	public void setServiceId(int serviceId) {
		this.serviceId = serviceId;
	}

	/**
	 * @return the serviceName
	 */
	@Column(name = "ServiceName")
	public String getServiceName() {
		return serviceName;
	}

	/**
	 * @param serviceName
	 *            the serviceName to set
	 */
	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}

	/**
	 * @return the shortDescription
	 */
	@Column(name = "ShortDescription")
	public String getShortDescription() {
		return shortDescription;
	}

	/**
	 * @param shortDescription
	 *            the shortDescription to set
	 */
	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	/**
	 * @return the subTypeId
	 */
	@Column(name = "SubTypeId")
	public int getSubTypeId() {
		return subTypeId;
	}

	/**
	 * @param subTypeId
	 *            the subTypeId to set
	 */
	public void setSubTypeId(int subTypeId) {
		this.subTypeId = subTypeId;
	}

	/**
	 * @return the contact
	 */

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "LeadContactId", nullable = false)
	public Contact getContact() {
		return contact;
	}

	/**
	 * @param contact
	 *            the contact to set
	 */
	public void setContact(Contact contact) {
		this.contact = contact;
	}

	/**
	 * @return the clientDescription
	 */
	@Column(name = "ClientDescription")
	public String getClientDescription() {
		return clientDescription;
	}

	/**
	 * @param clientDescription
	 *            the clientDescription to set
	 */
	public void setClientDescription(String clientDescription) {
		this.clientDescription = clientDescription;
	}

	/**
	 * @return the serviceAttendableId
	 */
	@Column(name = "ServiceAttendableId")
	public int getServiceAttendableId() {
		return serviceAttendableId;
	}

	/**
	 * @param serviceAttendableId
	 *            the serviceAttendableId to set
	 */
	public void setServiceAttendableId(int serviceAttendableId) {
		this.serviceAttendableId = serviceAttendableId;
	}

	/**
	 * @return the deptCode
	 */
	@Column(name = "DeptCode")
	public Integer getDeptCode() {
		return deptCode;
	}

	/**
	 * @param deptCode
	 *            the deptCode to set
	 */
	public void setDeptCode(Integer deptCode) {
		this.deptCode = deptCode;
	}

	/**
	 * @return the serviceTypeId
	 */
	@Column(name = "ServiceTypeId")
	public int getServiceTypeId() {
		return serviceTypeId;
	}

	/**
	 * @param serviceTypeId
	 *            the serviceTypeId to set
	 */
	public void setServiceTypeId(int serviceTypeId) {
		this.serviceTypeId = serviceTypeId;
	}

	/**
	 * @return the details2
	 */
	@Column(name = "Details2")
	public int getDetails2() {
		return details2;
	}

	/**
	 * @param details2
	 *            the details2 to set
	 */
	public void setDetails2(int details2) {
		this.details2 = details2;
	}

	/**
	 * @return the details3
	 */
	@Column(name = "Details3")
	public int getDetails3() {
		return details3;
	}

	/**
	 * @param details3
	 *            the details3 to set
	 */
	public void setDetails3(int details3) {
		this.details3 = details3;
	}

	/**
	 * @return the status
	 */
	@Column(name = "Status")
	public Boolean getStatus() {
		return status;
	}
	
	

	

	public Service(int serviceId, String serviceName, String shortDescription,
			int subTypeId, Contact contact, String clientDescription,
			int serviceAttendableId, Integer deptCode, int serviceTypeId,
			int details2, int details3, Boolean status, Date startExpectedDate,
			Date startDate, Date endDate, String serviceFullDescription,
			String descriptionDelivery, int serviceContractCode,
			String serviceContractValue, Boolean isContractStagedPayment,
			int referralMethodId, int timeLimitedYear, int timeLimitedMonth,
			Set<Premise> premises, Set<Organisation> organisationServices,
			Set<ReferenceData> referenceData) {
		super();
		this.serviceId = serviceId;
		this.serviceName = serviceName;
		this.shortDescription = shortDescription;
		this.subTypeId = subTypeId;
		this.contact = contact;
		this.clientDescription = clientDescription;
		this.serviceAttendableId = serviceAttendableId;
		this.deptCode = deptCode;
		this.serviceTypeId = serviceTypeId;
		this.details2 = details2;
		this.details3 = details3;
		this.status = status;
		this.startExpectedDate = startExpectedDate;
		this.startDate = startDate;
		this.endDate = endDate;
		this.serviceFullDescription = serviceFullDescription;
		this.descriptionDelivery = descriptionDelivery;
		this.serviceContractCode = serviceContractCode;
		this.serviceContractValue = serviceContractValue;
		this.isContractStagedPayment = isContractStagedPayment;
		this.referralMethodId = referralMethodId;
		this.timeLimitedYear = timeLimitedYear;
		this.timeLimitedMonth = timeLimitedMonth;
		this.premises = premises;
		this.organisationServices = organisationServices;
		this.referenceData = referenceData;
	}

	/**
	 * @param status
	 *            the status to set
	 */
	public void setStatus(Boolean status) {
		this.status = status;
	}

	/**
	 * @return the startExpectedDate
	 */
	@Column(name = "StartExpectedDate")
	public Date getStartExpectedDate() {
		return startExpectedDate;
	}

	/**
	 * @param startExpectedDate
	 *            the startExpectedDate to set
	 */
	public void setStartExpectedDate(Date startExpectedDate) {
		this.startExpectedDate = startExpectedDate;
	}

	/**
	 * @return the startDate
	 */
	@Column(name = "StartDate")
	public Date getStartDate() {
		return startDate;
	}

	/**
	 * @param startDate
	 *            the startDate to set
	 */
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	/**
	 * @return the endDate
	 */
	@Column(name = "EndDate")
	public Date getEndDate() {
		return endDate;
	}

	/**
	 * @param endDate
	 *            the endDate to set
	 */
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	/**
	 * @return the serviceFullDescription
	 */
	@Column(name = "ServiceFullDescription")
	public String getServiceFullDescription() {
		return serviceFullDescription;
	}

	/**
	 * @param serviceFullDescription
	 *            the serviceFullDescription to set
	 */
	public void setServiceFullDescription(String serviceFullDescription) {
		this.serviceFullDescription = serviceFullDescription;
	}

	/**
	 * @return the descriptionDelivery
	 */
	@Column(name = "DescriptionDelivery")
	public String getDescriptionDelivery() {
		return descriptionDelivery;
	}

	/**
	 * @param descriptionDelivery
	 *            the descriptionDelivery to set
	 */
	public void setDescriptionDelivery(String descriptionDelivery) {
		this.descriptionDelivery = descriptionDelivery;
	}

	/**
	 * @return the serviceContractCode
	 */
	@Column(name = "ServiceContractCode")
	public int getServiceContractCode() {
		return serviceContractCode;
	}

	/**
	 * @param serviceContractCode
	 *            the serviceContractCode to set
	 */
	public void setServiceContractCode(int serviceContractCode) {
		this.serviceContractCode = serviceContractCode;
	}

	/**
	 * @return the serviceContractValue
	 */
	@Column(name = "ServiceContractValue")
	public String getServiceContractValue() {
		return serviceContractValue;
	}

	/**
	 * @param serviceContractValue
	 *            the serviceContractValue to set
	 */
	public void setServiceContractValue(String serviceContractValue) {
		this.serviceContractValue = serviceContractValue;
	}

	/**
	 * @return the isContractStagedPayment
	 */
	@Column(name = "IsContractStagedPayment")
	public Boolean getIsContractStagedPayment() {
		return isContractStagedPayment;
	}

	/**
	 * @param isContractStagedPayment
	 *            the isContractStagedPayment to set
	 */
	public void setIsContractStagedPayment(Boolean isContractStagedPayment) {
		this.isContractStagedPayment = isContractStagedPayment;
	}

	/**
	 * @return the referralMethodId
	 */
	@Column(name = "ReferralMethodId")
	public int getReferralMethodId() {
		return referralMethodId;
	}

	/**
	 * @param referralMethodId
	 *            the referralMethodId to set
	 */
	public void setReferralMethodId(int referralMethodId) {
		this.referralMethodId = referralMethodId;
	}

	/**
	 * @return the timeLimitedYear
	 */
	@Column(name = "TimeLimitedYear")
	public int getTimeLimitedYear() {
		return timeLimitedYear;
	}

	/**
	 * @param timeLimitedYear
	 *            the timeLimitedYear to set
	 */
	public void setTimeLimitedYear(int timeLimitedYear) {
		this.timeLimitedYear = timeLimitedYear;
	}

	/**
	 * @return the timeLimitedMonth
	 */
	@Column(name = "TimeLimitedMonth")
	public int getTimeLimitedMonth() {
		return timeLimitedMonth;
	}

	/**
	 * @param timeLimitedMonth
	 *            the timeLimitedMonth to set
	 */
	public void setTimeLimitedMonth(int timeLimitedMonth) {
		this.timeLimitedMonth = timeLimitedMonth;
	}

	/**
	 * @return the premises
	 */
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "service")
	public Set<Premise> getPremises() {
		return this.premises;
	}

	/**
	 * @param premises
	 *            the premises to set
	 */
	public void setPremises(Set<Premise> premises) {
		this.premises = premises;
	}

	/**
	 * @return the organisationServices
	 */
	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinTable(name = "Organisation_Service", joinColumns = { 
			@JoinColumn(name = "ServiceId", nullable = false, updatable = false) }, 
			inverseJoinColumns = { @JoinColumn(name = "OrgId", 
					nullable = false, updatable = false) })
	public Set<Organisation> getOrganisationServices() {
		return organisationServices;
	}

	/**
	 * @param organisationServices
	 *            the organisationServices to set
	 */
	public void setOrganisationServices(Set<Organisation> organisationServices) {
		this.organisationServices = organisationServices;
	}

	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinTable(name = "Service_ReferenceDate", joinColumns = { 
			@JoinColumn(name = "ServiceId", nullable = false, updatable = false) }, 
			inverseJoinColumns = { @JoinColumn(name = "RefId", 
					nullable = false, updatable = false) })
	public Set<ReferenceData> getReferenceData() {
		return referenceData;
	}

	public void setReferenceData(Set<ReferenceData> referenceData) {
		this.referenceData = referenceData;
	}

}